<template>
	<view class="content">
		<u-navbar :placeholder='true' title="月限制金额" leftIcon="arrow-leftward"
			@leftClick="leftClick('/pages/mine/setting/person/add')">
		</u-navbar>
		<view class="main">
			<view style="background-color: #fff;">
				<view class="form">
					<view class="form-l">
						1月
					</view>
					<view class="form-r">
						<input v-model="monthly_amount.January" class="input-item" type="number">
					</view>
				</view>
				<view class="form">
					<view class="form-l">
						2月
					</view>
					<view class="form-r">
						<input v-model="monthly_amount.February" class="input-item" type="number">
					</view>
				</view>
				<view class="form">
					<view class="form-l">
						3月
					</view>
					<view class="form-r">
						<input v-model="monthly_amount.March" class="input-item" type="number" placeholder="">
					</view>
				</view>
				<view class="form">
					<view class="form-l">
						4月
					</view>
					<view class="form-r">
						<input v-model="monthly_amount.April" class="input-item" type="number">
					</view>
				</view>
				<view class="form">
					<view class="form-l">
						5月
					</view>
					<view class="form-r">
						<input v-model="monthly_amount.May" class="input-item" type="number">
					</view>
				</view>
				<view class="form">
					<view class="form-l">
						6月
					</view>
					<view class="form-r">
						<input v-model="monthly_amount.June" class="input-item" type="number">
					</view>
				</view>
				<view class="form">
					<view class="form-l">
						7月
					</view>
					<view class="form-r">
						<input v-model="monthly_amount.July" class="input-item" type="number">
					</view>
				</view>
				<view class="form">
					<view class="form-l">
						8月
					</view>
					<view class="form-r">
						<input v-model="monthly_amount.August" class="input-item" type="number">
					</view>
				</view>
				<view class="form">
					<view class="form-l">
						9月
					</view>
					<view class="form-r">
						<input v-model="monthly_amount.September" class="input-item" type="number">
					</view>
				</view>
				<view class="form">
					<view class="form-l">
						10月
					</view>
					<view class="form-r">
						<input v-model="monthly_amount.October" class="input-item" type="number">
					</view>
				</view>
				<view class="form">
					<view class="form-l">
						11月
					</view>
					<view class="form-r">
						<input v-model="monthly_amount.November" class="input-item" type="number">
					</view>
				</view>
				<view class="form">
					<view class="form-l">
						12月
					</view>
					<view class="form-r">
						<input v-model="monthly_amount.December" class="input-item" type="number">
					</view>
				</view>
			</view>
		</view>
		<view class="btn" @click="submit">
			確定
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				monthly_amount: {
					January: '',
					February: '',
					March: '',
					April: '',
					May: '',
					June: '',
					July: '',
					August: '',
					September: '',
					October: '',
					November: '',
					December: '',
				}
			}
		},
		methods: {
			submit(){
				uni.setStorageSync('monthly_amount',this.monthly_amount)
				uni.navigateBack({
					delta:1
				})
			},
			leftClick(url) {
				uni.navigateBack({
					delta: 1
				})
			}
		}
	}
</script>


<style lang="scss">
	.content {
		background-color: #F5F6F9;
		width: 100%;
		min-height: 100vh;
		position: relative;

		.main {
			// background-color: #fff;

			.form {
				margin: 0 32rpx;
				padding: 32rpx 0;
				display: flex;
				justify-content: space-between;
				align-items: center;
				border-bottom: 1rpx solid #DEDEDE;

				.form-l {
					font-size: 32rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #666666;
				}

				.form-r {
					display: flex;
					align-items: center;

					// flex-direction: row-reverse;
					// margin-left: 48rpx;
					// flex: 1;
					// float: right;
					.picker {
						display: flex;
						align-items: center;
						justify-content: space-between;

						.uni-input {
							font-size: 32rpx;
							font-family: PingFang SC;
							font-weight: 500;
							color: #BEBEBE;
						}
					}

				}
			}

			.form:last-child {
				border-bottom: none;
			}
		}

		.open {
			font-size: 32rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #666666;
			margin-top: 22rpx;
			background-color: #fff;
			padding: 32rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
		}

		.btn {
			position: absolute;
			bottom: 15rpx;
			left: 50%;
			transform: translateX(-50%);
			font-size: 32rpx;
			font-family: PingFang SC;
			font-weight: bold;
			line-height: 80rpx;
			color: #FFFFFF;
			width: 686rpx;
			height: 80rpx;
			text-align: center;
			background: #645AED;
			border-radius: 30rpx;
		}
	}
</style>